package com.sec.moveFile.controller;

import com.sec.moveFile.service.MoveFileService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 68300119
 * @Date 2021/5/26
 **/
@RestController
public class MoveFileController {

    private final MoveFileService moveFileService;

    public MoveFileController(MoveFileService moveFileService) {
        this.moveFileService = moveFileService;
    }

    @GetMapping("/api/move")
    public void move(@RequestParam(value = "moveSize", defaultValue = "100000") Integer moveSize)
            throws InterruptedException {
        moveFileService.moveFile(moveSize);
    }

    @GetMapping("/api/check")
    public void check() throws InterruptedException {
        moveFileService.check();
    }

}
